home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 22 / Amiga Format AFCD22 (Jan 1998, Issue 106).iso / -seriously_amiga- / shareware / programming / other / hunk / hoppers / general020.hop < prev    next >
Text File  |  1997-11-17  |  3KB  |  140 lines

  1. ;*************************************************************************
  2. ;** General Optimizer PC Absolute to Relative                           **
  3. ;** Contributor: Thomas Richter (thor)                  Nov  1st  1997  **
  4. ;** Modify all absolute addressing to PC relative if possible           **
  5. ;** This is especially for the MC68020. More optimisations are possible **
  6. ;*************************************************************************
  7.  
  8.  
  9.  
  10. ;*************************************************************************
  11. ;
  12. ; MOVE.L
  13. ;
  14. #match
  15. #code
  16. %0010XXXXXX111001  =# SourceEA          ;MOVE.L ABS,rx
  17. RRRR RRRR          =@ EA
  18. ;
  19. ;
  20. #replace
  21. %0010XXXXXX111010  =# SourceEA          ;MOVE.L d(PC),rx
  22. YYYY               =@ EA
  23. 4E71
  24. #end
  25.  
  26.  
  27. ;*************************************************************************
  28. ;
  29. ; MOVE.W
  30. ;
  31. #match
  32. #code
  33. %0011XXXXXX111001  =# SourceEA          ;MOVE.W ABS,rx
  34. RRRR RRRR          =@ EA
  35. ;
  36. ;
  37. #replace
  38. %0011XXXXXX111010  =# SourceEA          ;MOVE.W d(PC),rx
  39. YYYY               =@ EA
  40. 4E71
  41. #end
  42.  
  43.  
  44. ;*************************************************************************
  45. ;
  46. ; MOVE.B
  47. ;
  48. #match
  49. #code
  50. %0001XXXXXX111001  =# SourceEA          ;MOVE.L ABS,rx
  51. RRRR RRRR          =@ EA
  52. ;
  53. ;
  54. #replace
  55. %0001XXXXXX111010  =# SourceEA          ;MOVE.L d(PC),rx
  56. YYYY               =@ EA
  57. 4E71
  58. #end
  59.  
  60.  
  61. ;*************************************************************************
  62. ;
  63. ; MOVE.L #???,Ax        ->      LEA
  64. ;
  65. #match
  66. #code
  67. %0010XXX001111100  =# SourceEA          ;MOVE.L #ABS,Ax
  68. RRRR RRRR          =@ EA
  69. ;
  70. ;
  71. #replace
  72. %0100XXX111111010  =# SourceEA          ;LEA d(PC),Ax
  73. YYYY               =@ EA
  74. 4E71
  75. #end
  76.  
  77. ;*************************************************************************
  78. ;
  79. ; JMP Abs
  80. ;
  81. #match
  82. #code
  83. 4EF9                                    ; JMP Abs.L
  84. RRRR RRRR         =@ EA
  85. ;
  86. ;
  87. #replace
  88. 60FF                                    ; BRA.L d
  89. YYYY YYYY         =@ EA
  90. #end
  91.  
  92. ;*************************************************************************
  93. ;
  94. ; JSR Abs
  95. ;
  96. #match
  97. #code
  98. 4EB9                                    ; JSR Abs.L
  99. RRRR RRRR         =@ EA
  100. ;
  101. ;
  102. #replace
  103. 61FF                                    ; BSR.L d(PC)
  104. YYYY YYYY         =@ EA
  105. #end
  106.  
  107. ;*************************************************************************
  108. ;
  109. ; PEA Abs
  110. ;
  111. #match
  112. #code
  113. 4879                                    ; PEA Abs.L
  114. RRRR RRRR         =@ EA
  115. ;
  116. ;
  117. #replace
  118. 487A                                    ; PEA d(PC)
  119. YYYY              =@ EA
  120. 4E71
  121. #end
  122.  
  123. ;*************************************************************************
  124. ;
  125. ; LEA Abs
  126. ;
  127. #match
  128. #code
  129. %0100XXX111111001 =# SourceEA           ; LEA Abs.l,Ax
  130. RRRR RRRR         =@ EA
  131. ;
  132. ;
  133. #replace
  134. %0100XXX111111010 =# SourceEA           ; LEA d(PC),Ax
  135. YYYY              =@ EA
  136. 4E71
  137. #end
  138.  
  139.  
  140.